package com.example.demo;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {
	
	@GetMapping("/download")
	public void download(HttpServletResponse response) {
		String excelName = "abc";
		List<TItem> excelAllTItemList = new ArrayList<TItem>();
		excelAllTItemList.add(new TItem("123"));
		excelAllTItemList.add(new TItem("567"));
		LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
		fieldMap.put("iId", "商品ID");
		NewExportToExcelUtil.export(excelName, excelAllTItemList, fieldMap, response);
	}
	
	@GetMapping("/")
	public String index(HttpServletResponse response) {
		return "index";
	}
}
